from __future__ import annotations

from typing import Dict, Any


def basic_clean_kline(row: Dict[str, Any]) -> Dict[str, Any]:
    """K线基础清洗：保证关键字段存在并转换类型。"""
    row = dict(row)
    # 确保关键数值字段存在，缺失时使用简单默认值
    for key in ("open", "high", "low", "close", "volume", "turnover"):
        row[key] = float(row.get(key, 0.0))
    row["volume"] = int(row.get("volume", 0))
    return row




